package com.xw.bus;

import android.os.Bundle;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.support.v4.app.NavUtils;

public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        View u_name=findViewById(R.id.editText1);
        u_name.getBackground().setAlpha(200);
        u_name=findViewById(R.id.editText2);
        u_name.getBackground().setAlpha(200);
        u_name=findViewById(R.id.button1);
        //u_name.getBackground().setAlpha(150);
        u_name.setOnClickListener(new OnClickListener(){

			@Override
			public void onClick(View arg0) {
				// TODO Auto-generated method stub
				EditText mName=(EditText)findViewById(R.id.editText1);
				EditText mPwd=(EditText)findViewById(R.id.editText2);
				//if(mName.getText().toString().equals("admin") && mPwd.getText().toString().equals("861128"))
				if(true)
				{
					Intent intent=new Intent();
					intent.setClass(MainActivity.this, BusShow.class);
					startActivity(intent);
					MainActivity.this.finish();
				}
/*				else
				{
					new AlertDialog.Builder(MainActivity.this)
					.setTitle("Error")
					.setMessage("Please check the input!")
					.setPositiveButton("yes", null)
					.show();
				}*/
			}
        	
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }

    
}
